<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<style>
		.active{
			color: red;
		}
	</style>
	<body>
		<script src="../js/vue.js"></script>
		<div id="app">

			<ul>
				<li @click="click(index)" :class="{active:index===currIndex}" v-for="(item,index) in list">{{index}}-{{item}}
				</li>
			</ul>
		</div>
		<script>
			var app = new Vue({
				el: '#app',
				data: {
					list: ['海贼王', '火影忍者', '进击的巨人', '全职法师'],
					currIndex:0
				},
				methods: {
					click:function(index){
					this.currIndex=index
					}
				}
			})
		</script>
	</body>
</html>
